package com.br.dnaklass.core;

import java.util.ArrayList;
import java.util.List;

@SuppressWarnings( "rawtypes" )
public class FamilyTree {

	public static List<Class> getParents(Class klass) {
		List<Class> parents = new ArrayList<Class>();
		parents.add( obtainparents( klass, parents ) );
		return parents;
	}

	private static Class obtainparents( Class klass, List<Class> list ) {
		if ( klass.getSuperclass().equals( Object.class ) )
			return klass;
		list.add( obtainparents( klass.getSuperclass(), list ) );
		return klass;
	}
}
